package weka.association.apriori;

import java.util.ArrayList;
import weka.associations.ItemSet;
import weka.core.Instances;
import weka.core.converters.ConverterUtils.DataSource;

public class MyApriori
{
	private double support;
	private double confident;
	private ArrayList<ArrayList<ItemSet>> kItemSet;
	private ArrayList<MyItemSet> instances = new ArrayList<MyItemSet>();

	public void initInstances() throws Exception
	{
		DataSource ds = new DataSource("");
		Instances instances = ds.getDataSet();
		for (int i = 0; i < instances.numInstances(); i++)
		{
			MyItemSet itemSet = new MyItemSet();
			for (int j = 0; j < instances.numAttributes(); j++)
			{
               if(instances.instance(i).value(j)>0)
               {
            	   itemSet.getItemset().add(instances.attribute(j).name()) ;
               }
               this.instances.add(itemSet);
			}
		}
	}
	
	public void findFirstItemSet()
	{
		ArrayList<MyItemSet> list=new ArrayList<MyItemSet>();
		
	}

	
	
	
	
	
	
	
	
	
	
	
	
	
	public double getSupport()
	{
		return support;
	}

	public void setSupport(double support)
	{
		this.support = support;
	}

	public double getConfident()
	{
		return confident;
	}

	public void setConfident(double confident)
	{
		this.confident = confident;
	}

	public ArrayList<ArrayList<ItemSet>> getkItemSet()
	{
		return kItemSet;
	}

	public void setkItemSet(ArrayList<ArrayList<ItemSet>> kItemSet)
	{
		this.kItemSet = kItemSet;
	}

	public ArrayList<MyItemSet> getInstances()
	{
		return instances;
	}

	public void setInstances(ArrayList<MyItemSet> instances)
	{
		this.instances = instances;
	}
	
	
	
	
	
	
}
